import React from 'react'
import { Result, Button } from 'antd'
import { RouteComponentProps, withRouter } from 'react-router-dom'
import icon from '@assets/images/404.png'
import * as styles from './index.scss'
import { FormattedMessage, injectIntl } from 'react-intl'

type ReduxType = RouteComponentProps

const Error: React.FC<ReduxType> = (props: ReduxType) => {
  return (
    <div className={styles.container}>
      <Result
        icon={<img src={icon} />}
        title='404'
        subTitle={<FormattedMessage id={'n404Description'} />}
        extra={<Button type='primary' onClick={() => { props.history.push('/') }}><FormattedMessage id={'n404BackHome'} /></Button>}
      />
    </div>
  )
}

export default withRouter(Error)
